﻿<Window x:Class="ChristianMoser.WpfInspector.UserInterface.AnalyzerConfigurationWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Background="{DynamicResource WindowBackgroundBrush}"
    WindowStartupLocation="CenterOwner"
    Title="Active Rules" Height="350" Width="400" Icon="/Inspector;component/Images/Inspector.png">
    <Window.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="/Inspector;component/UserInterface/VisualResources/Inspector.xaml" />
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </Window.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="*" />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>
        <Border Background="{DynamicResource DefaultBackgroundBrush}">
            <ListBox Margin="8" x:Name="analyzerBox" Background="Transparent" BorderThickness="0" ItemsSource="{Binding Analyzers}" IsSynchronizedWithCurrentItem="True" >
                <ListBox.Resources>
                    <SolidColorBrush x:Key="{x:Static SystemColors.HighlightBrushKey}" Color="Transparent" />
                    <SolidColorBrush x:Key="{x:Static SystemColors.ControlBrushKey}" Color="Transparent" />
                </ListBox.Resources>
                <ListBox.GroupStyle>
                    <GroupStyle>
                        <GroupStyle.HeaderTemplate>
                            <DataTemplate>
                                <TextBlock Foreground="{DynamicResource DefaultForegroundBrush}" Margin="0,4,0,0" Height="22" VerticalAlignment="Center" Text="{Binding Name}" FontWeight="Bold" />
                            </DataTemplate>
                        </GroupStyle.HeaderTemplate>
                    </GroupStyle>
                </ListBox.GroupStyle>
                <ListBox.ItemTemplate>
                    <DataTemplate>
                        <StackPanel VerticalAlignment="Center" Height="24" Orientation="Horizontal">
                            <CheckBox VerticalAlignment="Center" IsChecked="{Binding IsActive, Mode=TwoWay}" />
                            <TextBlock Margin="8,0" VerticalAlignment="Center" Text="{Binding Name}" />
                        </StackPanel>
                    </DataTemplate>
                </ListBox.ItemTemplate>
            </ListBox>
        </Border>
        <StackPanel Margin="8,8,8,8" Grid.Row="2" HorizontalAlignment="Right">
            <Button IsDefault="True"  Click="Button_Click"  >
                <TextBlock Text="Close"  />
            </Button>
        </StackPanel>
    </Grid>
</Window>
